<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('项目信息查看')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <!--<div class="col-sm-12 search-collapse">
            <div class="select-list">
                    <div>在页面上无法直接访问templates目录下的html页面</div>
                <ul>
                    <li><a href="info.html">项目信息查看</a></li>
                    <li><a href="taskallocation.html">项目任务分配</a></li>
                    <li><a href="progressinquiry.html">项目进度查询</a></li>
                    <li><a href="progressacceptance.html">项目进度验收</a></li>
                    <li><a href="filingaudit.html">项目归档审核</a></li>
                </ul>
            </div>
        </div>-->
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            项目名称：<input type="text" name="pmName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <!--<div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="pm:info:add">
                <i class="fa fa-plus"></i> 新增
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()"
               shiro:hasPermission="pm:info:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
               shiro:hasPermission="pm:info:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="pm:info:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>-->

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('pm:info:edit')}]];
    //查看
    var viewInfoFlag = [[${@permission.hasPermi('pm:common:viewInfo')}]];
    var removeFlag = [[${@permission.hasPermi('pm:info:remove')}]];
    var datas = [[${@dict.getType('sys_normal_disable')}]];
    //这里的ctx其实就是定义了  "/"
    var prefix = ctx + "pm/info";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            viewUrl: "common/viewinfo/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            sortName: "pmId",//根据id来给他排序
            modalName: "项目信息",
            columns: [{
                checkbox: true
            },
                {
                    field: 'pmNum',
                    title: '项目编号'
                },
                {
                    field: 'pmName',
                    title: '项目名称',
                    sortable: true
                },
                {
                    field: 'pmClasses',
                    title: '项目类别',
                    sortable: true
                },
                {
                    field: 'pmClient',
                    title: '所属客户',
                    sortable: true
                },
                {
                    field: 'pmStatus',
                    title: '项目状态',
                    align: 'center',
                    formatter: function (value, row, index) {
                        return value == 0 ? "新项目":"旧项目";
                    }
                },
                {
                    field: 'createBy',
                    title: '创建人',
                    sortable: true
                },
                {
                    field: 'createTime',
                    title: '创建时间',
                    sortable: true
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + viewInfoFlag + '" href="javascript:void(0)" onclick="$.operate.viewInfo(\'' + row.pmId + '\')"><i class="fa fa-search-minus"></i>查看</a> ');
                        // console.log("row.pmId=" + row.pmId);
                        // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.postId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.postId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>